#include <string.h>
#include <strings.h>
#include "clist.h"

typedef struct cstring
{
  char* string;

  /*does not include '\0'*/
  int length;
} cstring_t;

cstring_t* new_cstring();

int cstring_cmp(cstring_t* left, cstring_t* right);

int cstring_casecmp(cstring_t* left, cstring_t* right);

int cstring_cmp_oldstr(cstring_t* left, const char* right);

void cstring_cat(cstring_t* left, cstring_t* right);

void cstring_cat_oldstr(cstring_t* left, const char* right);

cstring_t* cstring_substr(cstring_t* str, int start, int end);

cstring_t* cstring_dup(cstring_t* str);

int cstring_len(cstring_t* str);

clist_t* cstring_split(cstring_t* str, cstring_t* delim);

clist_t* cstring_split_oldstr(cstring_t* str, const char* delim);

clist_t* cstring_split_char(cstring_t* str, char delim);

void cstring_free(cstring_t* str);
